#pragma once
#include "Precompile.h"
#include "RenderSystem.h"

namespace Graphics{
	class DX10RenderContext : public RenderContext{
	public:
		DX10RenderContext(){}
		~DX10RenderContext(){}

		ID3D10Device *m_device;
	};

	class DX10RenderSystem : public RenderSystem{
	public:
		DX10RenderSystem(RenderMode &mode);
		~DX10RenderSystem();

		void initialize(HWND hwnd);
		void resetRenderSystem(RenderMode &mode);

		void update();
	private:
		void beginFrame();
		void endFrame();

		void cleanup();
		UINT getSampleCount();
		void setViewport();
		void setRasterizerState();
	private:
		ID3D10Device			*m_deviceHandle;
		ID3D10RenderTargetView 	*m_mainRenderTarget;
		ID3D10Texture2D			*m_mainRenderTargetTexture;
		ID3D10DepthStencilView 	*m_mainDepthStencil;
		ID3D10Texture2D			*m_mainDepthStencilTexture;

		ID3D10RenderTargetView 	*m_origRenderTarget;
		ID3D10Texture2D			*m_origRenderTargetTexture;
		ID3D10DepthStencilView 	*m_origDepthStencil;
		ID3D10Texture2D			*m_origDepthStencilTexture;

		ID3D10RasterizerState	*m_currentRasterizerState;

		IDXGISwapChain			*m_swapChain;

		HWND					m_hWnd;
	};
}